class SoTransaction < ActiveRecord::Base
  belongs_to :customer
  has_many :payments
  
  #====== validations =========
  validates_presence_of :amount, :customer_id,:date
  validates_numericality_of :amount
  
  
  def set_code
    self.code =  Time.now.strftime("%Y%m%d%H%M%S")
  end
  
  
  
end
